import { S } from '../s';
import { IPSCodeItem } from './ipscode-item';
import { IPSLanguageRes } from '../res/ipslanguage-res';
import { IPSSysCss } from '../res/ipssys-css';
import { IPSSysImage } from '../res/ipssys-image';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSCodeItemImpl extends PSModelObjectImpl implements IPSCodeItem {
  get bKColor(): string {
    return this.M.bKColor;
  }

  get beginValue(): number {
    return this.M.beginValue;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get color(): string {
    return this.M.color;
  }

  get data(): string {
    return this.M.data;
  }

  get endValue(): number {
    return this.M.endValue;
  }

  get iconCls(): string {
    return this.M.iconCls;
  }

  get iconClsX(): string {
    return this.M.iconClsX;
  }

  get iconPath(): string {
    return this.M.iconPath;
  }

  get iconPathX(): string {
    return this.M.iconPathX;
  }

  protected pscodeitems: IPSCodeItem[];
  getPSCodeItems(): IPSCodeItem[] | null {
    return (
      this.pscodeitems ||
      (this.pscodeitems = this.fillChildListModel(
        this.M.getPSCodeItems,
        S._91,
      ) as IPSCodeItem[])
    );
  }

  findPSCodeItem(objKey: any): IPSCodeItem | null {
    return this.getPSModel5(
      S._91,
      this.getPSCodeItems(),
      objKey,
    ) as IPSCodeItem;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  get text(): string {
    return this.M.text;
  }

  get textCls(): string {
    return this.M.textCls;
  }

  protected textpslanguageres: IPSLanguageRes;
  getTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.textpslanguageres ||
      (this.textpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTextPSLanguageRes,
        S._2df,
      ) as IPSLanguageRes)
    );
  }

  get tooltip(): string {
    return this.M.tooltip;
  }

  protected tooltippslanguageres: IPSLanguageRes;
  getTooltipPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.tooltippslanguageres ||
      (this.tooltippslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTooltipPSLanguageRes,
        S._2c5,
      ) as IPSLanguageRes)
    );
  }

  get userData(): string {
    return this.M.userData;
  }

  get userData2(): string {
    return this.M.userData2;
  }

  get value(): string {
    return this.M.value;
  }

  get default(): boolean {
    return this.M.default != null ? this.M.default : false;
  }

  get disableSelect(): boolean {
    return this.M.disableSelect != null ? this.M.disableSelect : false;
  }

  get includeBeginValue(): boolean {
    return this.M.includeBeginValue != null ? this.M.includeBeginValue : false;
  }

  get includeEndValue(): boolean {
    return this.M.includeEndValue != null ? this.M.includeEndValue : false;
  }

  get showAsEmtpy(): boolean {
    return this.M.showAsEmtpy != null ? this.M.showAsEmtpy : false;
  }
  get cls(): string {
    return 'PSCodeItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._91) return true;
    return super.instanceof(cls);
  }
}
